package com.lb.function;

import cn.hutool.core.util.StrUtil;

import java.util.function.Function;
import java.util.function.Supplier;

/**
 * @author zhangjun
 * @since 2025/04/21
 */
public class FunctionTest {
    public static void main(String[] args) {
        Function<String, String> function = s -> {
            String text = null;
            if (StrUtil.equals(s, "1")) {
                text = "高手";
            }
            if (StrUtil.equals(s, "2")) {
                text = "菜鸟";
            }
            if (StrUtil.equals(s, "3")) {
                text = "学长学姐";
            }
            return text;
        };

        System.out.println(function.apply("1"));

        System.out.println("----------------------");

        Supplier<String> supplier = StrUtil::uuid;
        System.out.printf("Uuid是：{%s}%n", supplier.get());

        FunctionTest test = new FunctionTest();
        System.out.printf("Uuid是：{%s}%n", test.getUuid());
    }

    Supplier<String> supplier = StrUtil::uuid;

    private String getUuid() {
        return supplier.get();
    }
}
